#!/bin/sh

#获取虚拟网卡IP
ip_addr=$(ifconfig eth0|sed -n '2p'|sed -r 's/^[^0-9]+([0-9.]+).*/\1/')
#写入配置
mkdir "/root/.uam"
echo [net] >> "/root/.uam/uam.ini"
echo listens=[$ip_addr]:${PORT}>> "/root/.uam/uam.ini"
#删除log
rm -rf /root/miner.log
#启动
/opt/uam/uam --no-ui --http [0.0.0.0]:20000 --pk 1B171AA3285F8976A278A9C39DF418F19DFB43FE2793D29CD6A2630ADD65E651
sleep 2
exec /root/run.sh 